{include 'public/header.html'}  



  <div class="main-content">

    <div class="page-content">

      <div class="page-content-area" style="opacity: 0.8;"> <br>

        <div class="page-header">

          <h1> 班级管理 <small><i class="ace-icon fa fa-angle-double-right"></i> 班级列表 </small> </h1>

        </div>

        <div class="row">

          <div class="col-xs-12">

             <form method="post" class="form-horizontal" role="form" id="submitform" onsubmit="return false">

              <table class="table table-bordered table-hover">

                <thead>

                  <tr>

                    <th>ID</th>

                    <th>排序</th>

                    <th>名称</th>

                    <th>学生</th>

                    <th>老师</th>
                    <th>开始时间</th>
                    <th>结束时间</th>

                    <th>操作</th>

                  </tr>

                </thead>

                <tbody>

                {foreach $list.data as $v}

                  <tr>

                    <td><input type="checkbox" name="id[]" value="{$v['id']}"/>

                      {$v['id']}</td>

                    <td>{$v['score']}</td>

                    <td>{$v['classes']}</td>

                    <td>{$v['stnum']}</td>

                    <td>{$v['_tid']}</td>
                    <td>{$v['start']}</td>
                    <td>{$v['end']}</td>

                    <td><a href="{siteurl('con=admin/classes/edit')}&id={$v['id']}">编辑</a></td>

                </tr>

                {/foreach}

                <tr>

                    <td colspan="7"><input type="checkbox" onclick="var ck = this.checked;$('input[name=&quot;id[]&quot;]').each(function(){ this.checked = ck });">

                      <a class="btn btn-default btn-delete">删除</a>

                      <a class="btn btn-success" href="{siteurl('con=admin/classes/edit')}">+ 新增班级</a></td>

                  </tr>

                </tbody>

              </table>

              <table style="width:100%;" class="listpage">

                <tr>

                  <td>{showpage($list.page)}</td>

                </tr>

              </table>

             </form>

          </div>

        </div>

    </div>

  </div>

  

<script>

$(function(){

	$('.btn-delete').click(function(){

		var ckvals = $.selectCK('input[name="id[]"]');

		if(!ckvals){

			tooltipbox.show('请选择要操作的数据');

			return false;

		}

		tooltipbox.confirm('确定永久删除选中的数据？', function(data){

			tooltipbox.show('正在执行操作...');

			$.post('{siteurl("con=admin/classes/delete")}', data, function(res){

				if(res.code == 1){

					location.reload();

				}

				tooltipbox.show(res.msg);

			}, 'json').error(function(){

				tooltipbox.show('数据或网络错误');

			});

		}, false, { 'ids': ckvals });

	});

});

</script>  

{include 'public/footer.html'}  